//
//  CompetionCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/9/9.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "CompetionCell.h"

#import "InstituteModel.h"


@implementation CompetionCell


-(void)setInstiModl:(InstituteModel *)instiModl{
    _instiModl = instiModl;
    UIImageView *pictureView = [[UIImageView alloc] init];
    [self.contentView addSubview:pictureView];
    [pictureView sd_setImageWithURL:[NSURL URLWithString:_instiModl.logoPath] placeholderImage:[UIImage imageNamed:@""]];
    [pictureView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.contentView.mas_top);
        make.size.mas_equalTo(CGSizeMake(63, 63));
    }];
    pictureView.layer.cornerRadius = 5;
    pictureView.layer.masksToBounds = YES;
    UILabel *nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:nameLabel];
    nameLabel.text = _instiModl.name;
    nameLabel.font = [UIFont systemFontOfSize:13];
    nameLabel.textAlignment = NSTextAlignmentCenter;
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(pictureView.mas_bottom).offset(scaleTopAndBottom(10));
        make.right.left.equalTo(self.contentView);
        make.height.mas_equalTo(scaleTopAndBottom(20));
    }];

}



@end
